Skip to content

fix(claimant): check terminal markers before timing in poll cap count (#8853) - #8878

Merged
dezren39 merged 1 commit into
mainfrom
queue/15083-8853-claimant-poll
Nov 12, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/15083-8853-claimant-poll

Conversation

@dezren39

@dezren39 dezren39 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Fixes #8853.

_active_root_state in pm-stack/opencode-claimant/poll.py read _session_timing before checking terminal markers, so a finished root with a malformed timestamp (e.g. time={'idle': 123, 'updated': 'bad'}) classified as unknown (None), summarize_cap reported cap_room=None, and all claimant launches stayed blocked.

Fix: for a root outside the server's active set (active-set membership is checked first and stays authoritative), a terminal marker — time.idle on a dict time, or a top-level outcome — now classifies the root inactive before the timing read. A root with malformed timing and NO terminal marker still fails closed as unknown, per the #6868 discipline.

Tests (oracle: the acceptance example on issue #8853):

  • New: terminal marker + malformed timing is inactive; count_active_roots returns 0 and summarize_cap grants room.
  • New: outcome + malformed timing is inactive.
  • New: active-set membership still overrides a stored terminal marker.
  • Suites on the laptop: test_poll 68/68, test_claimant 23/23, test_launch_one 26/26, test_dispatch_batch 10/10, test_send_to_opencode 14/14.

Queue task 15083 (repo-health-code-pilot), lane any-b. Per the packet scope, the source thread on PR #8692 is left to the pr-comment-review job.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…#8853)

A finished root with a malformed timestamp classified unknown and blocked all launches via cap_room=None. Terminal markers (time.idle / outcome) are decidable without a readable clock; roots with malformed timing and no marker still fail closed.
@dezren39
dezren39 requested a review from a team as a code owner November 12, 2026 07:25
@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 55 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 20818de7-4ef4-4070-aaff-193aaa22376f
Commits

Reviewing files that changed from the base of the PR and between ed6a4d7 and 317fed5.

Files selected for processing: 2

  • pm-stack/opencode-claimant/poll.py
  • pm-stack/opencode-claimant/test_poll.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T07:28:24.278581Z 317fed5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39
dezren39 merged commit a5b2326 into main Nov 12, 2026
1 of 12 checks passed
@dezren39
dezren39 deleted the queue/15083-8853-claimant-poll branch November 12, 2026 07:29
@dezren39

Copy link
Copy Markdown
Member Author

Salvage check (queue §8 duplicate protocol): PR #8859 (head ee1a4fd, from triage task 15078) was diffed in full against this merged PR before closing it as the duplicate.

Result: nothing unique to salvage. Its poll.py change is the same terminal-marker check at the same point in _active_root_state (a dict time with a truthy idle, or a top-level outcome, returns inactive before _session_timing), plus two cosmetic differences (a docstring rewording, and renaming the now-redundant later idle binding to _). Its two regression tests assert the same acceptance behaviors this PR's tests cover (malformed-timing terminal root grants cap room; outcome with malformed timing is inactive); this PR additionally covers active-set membership overriding a stored terminal marker. The fix is live on main as a5b2326.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

claimant(poll): terminal roots with malformed timestamps block all launches — check terminal markers before timing (from PR #8692)

1 participant